﻿// 开发者:micropu
// 公司:佛山远钧智慧科技有限公司

using Admin.NET.Application.Service.Device.Dto;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TouchSocket.Http.WebSockets;

namespace Admin.NET.Application;
public interface IClientWebSocketManager
{
    void AddConnection(string deviceSn, IWebSocket webSocket);
    IWebSocket GetConnection(string deviceSn);
    void ReceiveMessage(string deviceSn, string message);
    Task RemoveConnectionAsync(string deviceSn);
    ConcurrentDictionary<string, IWebSocket> SelectAllConnections();
    Task<CommonClientResult> SendAndWaitForResponseAsync(string deviceSn, string message, TimeSpan timeout);
    Task SendAsync(string deviceSn, string message);
}
